package com.pollux.entity;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import javax.validation.constraints.NotNull;

import java.io.Serializable;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

@Data
@AllArgsConstructor
@NoArgsConstructor
/**
 * @TableName category
 */
public class Category implements Serializable {

    /**
     * 主键
     */
    @NotNull(message = "[主键]不能为空")
    @Schema(name = "id", description = "主键", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer id;

    /**
     * 分类id
     */
    @NotNull(message = "[分类id]不能为空")
    @Schema(name = "categoryId", description = "分类id", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer categoryId;

    /**
     * 分类名称
     */
    @NotBlank(message = "[分类名称]不能为空")
    @Size(max = 10, message = "编码长度不能超过10")
    @Schema(name = "categoryName", description = "分类名称", maxLength = 10, requiredMode = Schema.RequiredMode.REQUIRED)
    private String categoryName;
}
